﻿using System;
using System.ComponentModel;
using Loki.UI;
using Loki.Utils;
using Luna.Model;

namespace Luna.UI
{
    public class LunaDisplayable : Displayable<IApplicationModel>
    {
        #region ID

        private static PropertyChangedEventArgs _IDChangedArgs = ObservableHelper.CreateChangedArgs<LunaDisplayable>(x => x.ID);

        private static PropertyChangingEventArgs _IDChangingArgs = ObservableHelper.CreateChangingArgs<LunaDisplayable>(x => x.ID);

        private Guid _ID;

        public Guid ID
        {
            get
            {
                return _ID;
            }

            set
            {
                if (value != _ID)
                {
                    NotifyChanging(_IDChangingArgs);
                    _ID = value;
                    NotifyChangedAndDirty(_IDChangedArgs);
                }
            }
        }

        #endregion ID

        public LunaDisplayable()
        {
            _ID = Guid.NewGuid();
        }
    }
}